Upgrading an existing MySQL 5 database to MySQL 8 or MariaDB

MySQL 5 is no longer the last available technology you can use for your website, with the emergence of both MySQL 8 and MariaDB it is possible to update this to the latest technology. This process can seem challenging, but is taken care of in a few minutes once you know the exact steps you need to perform. Let's explain the necessary steps in this article, for this example we will use a website created with the Content Management System WordPress.

Collecting and writing down information

Before you start, it is important to put all the necessary data together, this can be done, for example, in a notepad on your computer. This way you can cut and paste the data, with less chance of spelling or typing errors.

Navigate to the wp-config.php file for this data. You can do this by logging into the control panel, and then navigating to the File Manager. Here, navigate further to the wwwroot folder, and open the wp-config.php file.(not the wp-config-sample.php file).

Make a note of the following extract from your wp-config.php file in notepad:

Upgrading an existing MySQL 5 database to MySQL 8 or MariaDB

Create new database

After this, go to MySQL 8 or MariaDB in your client panel, the choice between them is mainly up to you. If you want to know more about the choice, you can do further research on this yourself. The main difference is that MariaDB is completely open source and maintained by the community. MySQL 8 is still part of Oracle, which makes it not completely open source but partially closed source. Speed difference has been found to be zero from our tests, this may be different depending on your website.

Use the following steps to create a MySQL 8 or MariaDB database, again make a note of the details.

https://www.mijnhostingpartner.nl/client/knowledgebase/web-ontwikkeling/databases/mariadb/mariadb-en-user-aanmaken/

https://www.mijnhostingpartner.nl/client/knowledgebase/web-ontwikkeling/databases/mysql-8/mysql-8-database-aanmaken/


Exporting old data from MySQL 5

It is necessary to first export the data of the current MySQL 5 database, this can be done in several ways, but the easiest is to do it through PHPmyAdmin. You start this by navigating to the following URL in your browser:

https://mysqlwebadmin.nl

And log in to your server, using the data from your wp-config.php file. After this, click on the database again in the left menu to export the database data under the Export tab. This can be done with the quick option. You will get a .sql file in your downloads folder of your computer as soon as it is finished. Which you can then use to transfer the database.

Upgrading an existing MySQL 5 database to MySQL 8 or MariaDB

Importing old data from MySQL 5 into MySQL 8 or MariaDB

After you have exported the data from MySQL 5, you proceed to import the database within MySQL 8 or MariaDB. Again, you do this using PHPmyAdmin for convenience. You then just need to log into the corresponding database on the new host. Again, refer to the previous steps and the client panel if it is not yet completely clear what data you need for this.

Go to mysqlwebadmin.nl for this or for MariaDB mariadbwebadmin.nl and select your new server, log in with your newly created data.

After this, click the database again in the left menu, and go to Import. Then import your database by uploading and importing the data.

Upgrading an existing MySQL 5 database to MySQL 8 or MariaDB

You will see the message:

Upgrading an existing MySQL 5 database to MySQL 8 or MariaDB


Modify website configuration files

The last step is to change the website configuration files, you can do this either by logging in via FTP within your website, or directly via the control panel and navigating to it in the filemanager. First make a backup of your configuration file so that if you make a mistake you can quickly go back.

Here you change the database name, database username, password, and finally the host of the database. You do this for example in the following way:

Upgrading an existing MySQL 5 database to MySQL 8 or MariaDB

So use the data you saved earlier to change this successfully, after you have saved or uploaded this is immediately active. You can then check in WordPress itself if everything is OK. This can be done under the site health tools, and then under the info:

Upgrading an existing MySQL 5 database to MySQL 8 or MariaDB


These are further all the steps needed to switch your database to a later version. If you do not succeed, please create a ticket with your information and the steps you have already performed. Then we can help you further. We can also perform this work for you, but there are costs associated with this as it also takes us some time. More information can be requested via a ticket.